/* ******************************************************************
 * This file is part of the escal project and distributed under the
 * terms of the GNU General Public License Version 3
 * Copyright (C) 2008 Epocher (xijiaosdq@gmail.com)
 * See COPYING file for licensing information.
 *******************************************************************/

#ifndef INITIALIZER_H
#define INITIALIZER_H

#include  <QObject>

class ClientWatcher;
class QTcpServer;
class Initializer:public QObject{
	Q_OBJECT
public:
	Initializer(QObject *parent=0);
	~Initializer();
	bool initDaemon(int argc, char *argv[]);
	bool initFolders(int argc, char *argv[]);
	bool initSettings();
	bool initRuntime();
signals:
	void geturl(const QString &urlStr);
	void passUrl(const QString &urlStr);
	void quit();
public slots:
	void getUrlSlot(const QString &urlStr);
	void unInit();
	void getNewConnection();
	void clientQuited(ClientWatcher *client);
private:
	QList<ClientWatcher*> clientList;
	QTcpServer *server;
};
#endif /* INITIALIZER_H */
